<?php

namespace Wantuch\SurveyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="invitations")
 */
class Invitation
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="string", length=100, nullable=true)
     */
    protected $name;
    
    /**
     * @ORM\Column(type="string", length=100, nullable=true)
     */
    protected $surname;
    
    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $email;
    
    /**
     * @ORM\Column(type="string", length=100)
     */
    protected $token;
    
    /**
     * @ORM\Column(type="string", length=100, nullable=true)
     */
    protected $filled;
    
    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    protected $createdAt;
    
    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    protected $updatedAt;
    
    /**
     * @ORM\ManyToOne(targetEntity="Survey", inversedBy="invitations")
     * @ORM\JoinColumn(name="survey_id", referencedColumnName="id", nullable=true)
     **/
    private $survey;
  
    /**
     * @ORM\OneToMany(targetEntity="Comparison", mappedBy="invitation")
     **/
    private $comparisons;
    
    /**
     * @ORM\OneToOne(targetEntity="Result", mappedBy="invitation")
     **/
    private $result;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Invitation
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set surname
     *
     * @param string $surname
     * @return Invitation
     */
    public function setSurname($surname)
    {
        $this->surname = $surname;

        return $this;
    }

    /**
     * Get surname
     *
     * @return string 
     */
    public function getSurname()
    {
        return $this->surname;
    }

    /**
     * Set email
     *
     * @param string $email
     * @return Invitation
     */
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }

    /**
     * Get email
     *
     * @return string 
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Set token
     *
     * @param string $token
     * @return Invitation
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

    /**
     * Get token
     *
     * @return string 
     */
    public function getToken()
    {
        return $this->token;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     * @return Invitation
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set updatedAt
     *
     * @param \DateTime $updatedAt
     * @return Invitation
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

    /**
     * Get updatedAt
     *
     * @return \DateTime 
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }

    /**
     * Set survey
     *
     * @param \Wantuch\SurveyBundle\Entity\Survey $survey
     * @return Invitation
     */
    public function setSurvey(\Wantuch\SurveyBundle\Entity\Survey $survey = null)
    {
        $this->survey = $survey;

        return $this;
    }

    /**
     * Get survey
     *
     * @return \Wantuch\SurveyBundle\Entity\Survey 
     */
    public function getSurvey()
    {
        return $this->survey;
    }

    /**
     * Set filled
     *
     * @param string $filled
     * @return Invitation
     */
    public function setFilled($filled)
    {
        $this->filled = $filled;

        return $this;
    }

    /**
     * Get filled
     *
     * @return string 
     */
    public function getFilled()
    {
        return $this->filled;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->comparisons = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add comparisons
     *
     * @param \Wantuch\SurveyBundle\Entity\Comparison $comparisons
     * @return Invitation
     */
    public function addComparison(\Wantuch\SurveyBundle\Entity\Comparison $comparisons)
    {
        $this->comparisons[] = $comparisons;

        return $this;
    }

    /**
     * Remove comparisons
     *
     * @param \Wantuch\SurveyBundle\Entity\Comparison $comparisons
     */
    public function removeComparison(\Wantuch\SurveyBundle\Entity\Comparison $comparisons)
    {
        $this->comparisons->removeElement($comparisons);
    }

    /**
     * Get comparisons
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getComparisons()
    {
        return $this->comparisons;
    }

    /**
     * Set result
     *
     * @param \Wantuch\SurveyBundle\Entity\Result $result
     * @return Invitation
     */
    public function setResult(\Wantuch\SurveyBundle\Entity\Result $result = null)
    {
        $this->result = $result;

        return $this;
    }

    /**
     * Get result
     *
     * @return \Wantuch\SurveyBundle\Entity\Result 
     */
    public function getResult()
    {
        return $this->result;
    }
}
